import { onBeforeMount, onMounted, ref} from 'vue'
export default function(){
    const x = ref(-1);
        const y = ref(-1);
        const handler = (e:MouseEvent)=>{
                x.value = e.pageX;
                y.value = e.pageY
            }
        onMounted(()=>{
            window.addEventListener('click',handler)
        })
        onBeforeMount(()=>{
            window.removeEventListener("click",handler)
        })
        return {
            x,
            y
        }
}